package com.xiaobo.framework.endpoint;

import com.xiaobo.framework.api.bean.Message;
import com.xiaobo.framework.service.MessageService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: <a href="get_xiaobo@163.com">Josh_Xu</a>
 * @description:
 * @create: 2020-04-26 13:50
 **/
@RestController
@RequestMapping("/message")
@CrossOrigin
public class MessageEndpoint {

    @Autowired
    private MessageService messageService;

    @GetMapping
    ResponseEntity<?> queryMessageList(@RequestParam("fromId") Long fromId,
                                       @RequestParam("toId") Long toId,
                                       @RequestParam("page") Integer page,
                                       @RequestParam("rows") Integer rows){
    List<Message> list=this.messageService.queryMessageList(fromId,toId,page,rows);
    return ResponseEntity.ok().build();
    }
}
